package org.nepu.scr.indexrate.converter.compliancerate.operationreliability;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.compliancerate.operationreliability.WellControlA113;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class WellControlA113Converter implements AttributeConverter<WellControlA113, String> {
    @Override
    public String convertToDatabaseColumn(WellControlA113 wellControlA113) {
        return JSONUtil.toJsonStr(wellControlA113);
    }

    @Override
    public WellControlA113 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, WellControlA113.class);
    }
}
